<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="vue.js"></script>
    <title>Document</title>
</head>
<body>
    <style>
        body {
            font-family: Arial, Helvetica, sans-serif;
        }
        .tab {
            width: 600px;
            margin: 0 auto;
            border:1px solid black;
        }
        .header {
            font-size: 0;
            width: 600px;
            border-bottom: 1px solid #666;
        }
        .header a {
            display: inline-block;
            height: 40px;
            line-height: 40px;
            font-size: 16px;
            width: 25%;
            text-align: center;
            color: #333;
            text-decoration: none;
        }
        .selected {
            background-color: #09f;
            color: #fff !important;
        }

        .show > div {
            border: 1px solid #ccc;
            height: 400px;
            padding-top: 20px;
        }

    </style>
</head>
<body>
    <div id="app">
        <div class="tab">
            <div class="header">
                <a :class="{selected:currentPage==0}" href="#" @click.prevent="changePage(0)">HTML</a>
                <a :class="{selected:currentPage==1}" href="#" @click.prevent="changePage(1)">CSS</a>
                <a :class="{selected:currentPage==2}" href="#" @click.prevent="changePage(2)">JavaScript</a>
                <a :class="{selected:currentPage==3}" href="#" @click.prevent="currentPage=3">Vue</a>
            </div>
            <div class="show">
                <div v-show="currentPage==0">HTML</div>
                <div v-show="currentPage==1">CSS</div>
                <div v-show="currentPage==2">JavaScript</div>
                <div v-show="currentPage==3">Vue</div>
            </div>
        </div>
        
    </div>
</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            currentPage: 0
        },
        methods: {
            changePage(page){
                this.currentPage = page
            }
        },
    })
</script>
</html>
</body>
</html>